<template>
	<el-drawer title="项目文档详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-form-item label="排序号" prop="sortNo">{{form.sortNo}}
					</el-form-item>
					<el-form-item label="文件名称" prop="fileName">{{form.fileName}}
					</el-form-item>
					<el-form-item label="关联项目" prop="proId">{{form.title}}
					</el-form-item>
					<el-form-item label="文档摘要" prop="remark">{{form.remark}}
					</el-form-item>
					<el-form-item label="相关附件" v-if="form.attachId!=''">
						<attach-menu :attachIds="form.attachId" :roleFlag="3" :preview="true"></attach-menu>
					</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'
export default {
	emits: ['success', 'closed'],
	components: {
		AttachMenu
	},
	data() {
		return {
			loading: false,
			form: {
				proId:'',
				sortNo:0,
				title: '',
				proCode: '',
				fileName:'',
				remark:'',
				attachId:''
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(model){
			this.model=model;
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data){
			this.form.sortNo = data.sortNo
			this.form.proId = data.proId
			this.form.title = data.title
			this.form.fileName = data.fileName
			this.form.remark = data.remark
			this.form.attachId = data.attachId
		},
	}
}
</script>

<style>
</style>
